package com.shujia.mlib

import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.linalg.Vector
object Demo1Vector {
  def main(args: Array[String]): Unit = {
    //稠密向量
    val dv = Vectors.dense(1.0, 0.0, 3.0)
    println(dv)


    //稀疏向量
    val sv1: Vector = Vectors.sparse(3, Array(0, 2), Array(1.0, 3.0))
    println(sv1)
  }
}
